A step (sasl-step object) is an abstraction of
authentication “step” which holds the response value
and the next entry point for the authentication process (the
latter is not accessible).
To get the initial response, you should call the function
sasl-next-step with the second argument
nil.
(setq name (sasl-mechanism-name mechanism))
At this point we could send the command which starts a SASL authentication protocol exchange. For example,
(process-send-string
process
(if (sasl-step-data step) ;initial response
(format "AUTH %s %s\r\n" name (base64-encode-string (sasl-step-data step) t))
(format "AUTH %s\r\n" name)))
To go on with the authentication process, all you have to do
is call sasl-next-step consecutively.